package com.yn.xgame.logic.util;

import redis.clients.jedis.Jedis;

public class JedisUtils {

	private static Jedis jedis;

	private static String ip;
	private static int port;

	public static void init(String ip, int port) {
		JedisUtils.ip = ip;
		JedisUtils.port = port;
	}
	
	public static Jedis getJedis(){
		if (jedis == null || !jedis.isConnected()) {
			jedis = new Jedis(ip, port);
		}
		return jedis;
	}
	
}
